package com.cw.jeeyt.common.enums;

/**
 * swagger标签枚举
 */
public enum EnumSwaggerTag {
    /** Api **/
    Api("Api", "Api"),
    /** ApiModel **/
    ApiOperation("ApiOperation", "ApiOperation"),
    ApiModel("ApiModel", "ApiModel"),
    /** ApiModelProperty **/
    ApiModelProperty("ApiModelProperty", "ApiModelProperty"),
    /** ApiParam **/
    ApiParam("ApiParam", "ApiParam"),;
    /** 编码 **/
    private String code;
    /** 描述 **/
    private String description;

    /**
     * 私有构造方法
     *
     * @param code 编码
     * @param description 描述
     **/
    EnumSwaggerTag(String code, String description) {
        this.code = code;
        this.description = description;
    }

    /**
     * 根据编码查找枚举
     *
     * @param code 编码
     **/
    public static EnumSwaggerTag find(String code) {
        for (EnumSwaggerTag frs : EnumSwaggerTag.values()) {
            if (frs.getCode()
                .equals(code)) {
                return frs;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }
}
